<div class="page-header clearfix">
	<h1 class="col-sm-8">分类列表</h1>
	<div class="col-sm-4 pull-right search_box">
		<form name="form_search" id="form_search" method="post">
			<div class="input-group">
				<input  class="form-control" type="text" name="keyword" id="keyword"/>
				<div class="input-group-btn">
					<a class="btn btn-sm btn-info" onclick="submit_search();"><i class="icon-search" ></i></a>
					<a class="btn btn-sm btn-success" onclick="toggle_adv_search();"><i id="toggle_adv_search_icon" class="icon-chevron-down bigger-125"></i></a>
				</div>
			</div>
		</form>
	</div>
</div>
<form method="post" name="form_adv_search" id="form_adv_search">
	<div class="adv_search panel panel-default  display-none"  id="adv_search">
		<div class="panel-heading">
			<div class="row">
				<h4 class="col-xs-6">高级搜索</h4>
				<div class="col-xs-6 text-right">
					<a  class="btn btn-sm btn-info" onclick="submit_adv_search();">搜索</a>
					<a  class="btn btn-sm " onclick="close_adv_search();">关闭</a>
				</div>
			</div>
		</div>
		<div class="panel-body">
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="li_B">时间：</label>
				<div class="col-sm-8">
					<input  class="form-control" type="text" id="li_B" name="li_B" >
				</div>
			</div>
			<div class="form-group col-sm-6">
				<label class="col-sm-4 control-label" for="li_C">名称：</label>
				<div class="col-sm-8">
					<input  class="form-control" type="text" id="li_C" name="li_C" >
				</div>
			</div>
		</div>
	</div>
</form>
<div class="operate panel panel-default">
		<div class="panel-body text-center">
			<div class="pull-left" id="main-sub-menu">
				<?php include $mainSubMenu;?>
			</div>
			<div class="pull-right">
			<a class="btn btn-sm btn-primary" onclick="updateAllCategoryStatus(1);">批量启用</a>
			<a class="btn btn-sm btn-danger" onclick="updateAllCategoryStatus(0);">批量禁用</a>
			</div>
		</div>
</div>
<div class="ul_table message-container">
	<ul>
		<div class="pagination"><?php echo $page;?></div>
		<li class="thead">
			<label class="inline pull-left col-3"><input class="ace" type="checkbox" name="id-toggle-all" id="id-toggle-all" /><span class="lbl"></span></label>
			<span class="col-8 text-center">ID</span>
			<span class="col-10 text-center">名称</span>
			<span class="col-8 text-center">排序</span>
			<span class="col-8 text-center">状态</span>
			<span class="col-10 text-center">操作</span>
		</li>
		<form method="post" action="" name="form_data" id="form_data">
		<?php foreach($lists as $list):?>
		<li class="tbody data_item<?php echo $list['parent_id'] == 0 ? ' root' : ''?>">
			<label class="inline pull-left col-3"><input class="ace" type="checkbox" name="id[]" value="<?php echo $list['id'];?>" /><span class="lbl"></span></label>
			<span class="col-8 text-center"><?php echo $list['id'];?></span>
			<span class="col-10 text-center"><?php echo $list['name'];?></span>
			<span class="col-8 text-center"><input type="text" id="<?php echo 'com.category_'.$list['id'].'_'.$list['sort'];?>" value="<?php echo $list['sort'];?>" class="sort" /></span>
			<span class="col-8 text-center"><?php echo $list['status'] == 1 ? '正常' : '禁用';?></span>
			<span class="col-10 text-center">
				<a href="<?php echo C('backend');?>index.php?com=items&c=category&m=edit&id=<?php echo $list['id'];?>" onclick="delMainSubMenuNode();">编辑</a> | 
				<!--TODO:: 两个onclick ? -->
				<?php if($list['status'] == 1):?>
				<a href="javascript:void(0);" onclick="updateCategoryStatus(<?php echo $list['id'];?>,0);" onclick="delMainSubMenuNode();">禁用</a>
				<?php else:?>
				<a href="javascript:void(0);" onclick="updateCategoryStatus(<?php echo $list['id'];?>,1);" onclick="delMainSubMenuNode();">启用</a>
				<?php endif;?>
			</span>
		</li>
		<?php endforeach;?>
		</form>
		<div class="pagination"><?php echo $page;?></div>
	</ul>
</div>
